Skip to content

Next security patch + search-scope batching, telemetry & DOM teardown guards#1132

Closed
BigSimmo wants to merge 6 commits into
mainfrom
codex/review-code-for-bugs-and-issues
Closed

Next security patch + search-scope batching, telemetry & DOM teardown guards#1132
BigSimmo wants to merge 6 commits into
mainfrom
codex/review-code-for-bugs-and-issues

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Motivation

  • Apply the latest Next.js/Next-tooling security/stability patch and address remaining merge-readiness issues while fixing several backend/frontend edge cases uncovered by focused reviews and tests.
  • Ensure label-filter queries are robust for large result sets and that failed search logging uses the parsed query for telemetry rather than an "unknown" placeholder.

Description

  • Bump Next-related packages to 16.2.11 in package.json / package-lock.json (next, @next/env, @next/bundle-analyzer, eslint-config-next), and include lockfile updates.
  • Add paginated label loading with batching and abort-signal propagation in src/lib/search-scope.ts via loadScopeLabels and related constants to avoid dropped label rows on large datasets.
  • Improve error-path telemetry and fallback logging in src/app/api/search/route.ts so query_class and logged query use the parsed request body when available.
  • Harden UI teardown: guard document usage in src/components/ui/sheet.tsx to avoid accessing DOM after teardown.
  • Adjust PDF extraction test timing and zombie-child detection in tests/pdf-extraction-budget.test.ts, and add/expand unit tests for search telemetry and label pagination/abort behavior in tests/private-access-routes.test.ts and tests/search-scope.test.ts.
  • Add a new ledger entry in docs/branch-review-ledger.md documenting the latest commit review and recommended merge-readiness steps.

Testing

  • Ran focused local checks: typecheck passed and updated unit tests for search-scope, private-access-routes, and pdf-extraction-budget executed under vitest and passed locally.
  • Local focused functional checks for the sheet DOM teardown and pdf extractor adjustments passed; npm audit reported 0 high vulnerabilities.
  • Full npm run verify:cheap / CI full-suite could not be executed in this environment due to a local Node version mismatch with the repo engines (node: 24.x required), so full CI verification remains gated on the CI runner.

Codex Task

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@cursor[bot], you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 25af56ee-ac2e-42b9-8701-27bca93d95d8

📥 Commits

Reviewing files that changed from the base of the PR and between 329ea48 and 02da53e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • docs/branch-review-ledger.md
  • package.json
  • src/app/api/search/route.ts
  • src/components/ui/sheet.tsx
  • src/lib/search-scope.ts
  • tests/pdf-extraction-budget.test.ts
  • tests/private-access-routes.test.ts
  • tests/search-scope.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/review-code-for-bugs-and-issues

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Jul 24, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review July 24, 2026 05:01
@BigSimmo
BigSimmo enabled auto-merge July 24, 2026 05:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 444972627e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/branch-review-ledger.md Outdated
@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 444972627e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/branch-review-ledger.md Outdated
cursoragent and others added 3 commits July 24, 2026 06:16
…-bugs-and-issues

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo disabled auto-merge July 24, 2026 06:50
@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex please resolve the merge conflict

docs/branch-review-ledger.md

please also fix and resolve the PR policy that is failing.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Updated the PR Next security patch + search-scope batching, telemetry & DOM teardown guards #1132 branch-review ledger entry to record the actual current reviewed head 31fd421b608d385f0f0623b177f2e8997b870446, describe the ledger merge-conflict/policy follow-up, and correctly note that src/lib/search-scope.ts is in scope. docs/branch-review-ledger.mdL710
  • Documented that the PR policy failure is metadata-only and that the PR body needs a RAG impact: declaration plus a fully checked Clinical Governance Preflight for the search/clinical-risk diff. docs/branch-review-ledger.mdL710
  • Committed the fix on the current branch as d1c34a1 docs: fix PR 1132 ledger record.
  • Created PR metadata with the make_pr tool, including a policy-compliant body with RAG impact: and Clinical Governance Preflight.

Testing

View task →

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • git diff --check
  • npm run check:pr-policy
  • node - <<'EOF' ... evaluatePullRequestPolicy(...) ... EOF — simulated the PR Next security patch + search-scope batching, telemetry & DOM teardown guards #1132 changed-file list against PR_POLICY_BODY.md; result was ok: true with no errors or warnings.
  • ⚠️ git fetch origin main --prune — could not verify/resolve the remote merge conflict locally because this checkout has no configured origin remote (fatal: 'origin' does not appear to be a git repository).

View task →

@BigSimmo
BigSimmo enabled auto-merge (squash) July 24, 2026 07:05
@BigSimmo
BigSimmo disabled auto-merge July 24, 2026 07:14
# Conflicts:
#	docs/branch-review-ledger.md

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo

Copy link
Copy Markdown
Owner Author

Closed after current-main reconciliation. This PR combines unrelated risk classes and should not be merged wholesale: Next.js 16.2.11 already landed in #1091; the Sheet teardown defect landed with stronger lifecycle coverage in #1161; the PDF timeout increase has no current-main malformed-asset reproducer; and the valid >1,000-label search-scope pagination defect is now durably queued as #75 in docs/outstanding-issues.md via #1165. #75 requires a separate bounded-pagination PR and protected RAG review only if measured retrieval behavior changes. The branch remains recoverable in the verified/final reconciliation bundles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants